<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:33:"themes/blog/category-article.html";i:1568365182;s:56:"D:\xampp\htdocs\TnCMS\public\themes\blog\common\nav.html";i:1568365182;s:58:"D:\xampp\htdocs\TnCMS\public\themes\blog\common\right.html";i:1568365182;s:59:"D:\xampp\htdocs\TnCMS\public\themes\blog\common\footer.html";i:1568365182;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo $tagName; ?>-<?php echo $siteInfo['title']; ?></title>
    <link rel="stylesheet" href="/themes/blog/static/layui/css/layui.css" />
    <link rel="stylesheet" href="/themes/blog/static/css/home.css" />
    <script type="text/javascript" src="/themes/blog/static/js/jquery-3.2.1.min.js" ></script>
    <script type="text/javascript" src="/themes/blog//static/layui/layui.js" ></script>
    <script type="text/javascript" src="/themes/blog/static/js/home.js" ></script>
</head>
<body>
<style>
  /*LOGO*/
.logo{font-size:20px;color: #FFFFFF;}
.logo:hover{color: #FFFFFF;}
</style>
<nav style="background-color: #393D49">
    <ul class="layui-nav" lay-filter="" style = "width:1200px;margin:0 auto;">
        <a class="logo" href="#"><?php echo $siteInfo['title']; ?></a>
        <li class="layui-nav-item layui-this"><a href="/">首页</a></li>
        <?php if(is_array($nav[0]) || $nav[0] instanceof \think\Collection || $nav[0] instanceof \think\Paginator): $i = 0; $__LIST__ = $nav[0];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <li class="layui-nav-item ">
          <a href="<?php echo $vo['url']; ?>"><?php echo $vo['nav_title']; ?></a>
          <?php if(!(empty($nav[$vo['nav_id']]) || (($nav[$vo['nav_id']] instanceof \think\Collection || $nav[$vo['nav_id']] instanceof \think\Paginator ) && $nav[$vo['nav_id']]->isEmpty()))): ?>
          <dl class="layui-nav-child">
             <?php if(is_array($nav[$vo['nav_id']]) || $nav[$vo['nav_id']] instanceof \think\Collection || $nav[$vo['nav_id']] instanceof \think\Paginator): $i = 0; $__LIST__ = $nav[$vo['nav_id']];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
            <dd><a href=""><?php echo $v['nav_title']; ?></a></dd>
            <?php endforeach; endif; else: echo "" ;endif; ?>
          </dl>
           <?php endif; ?>
        </li>
        <?php endforeach; endif; else: echo "" ;endif; if(empty($userInfo) || (($userInfo instanceof \think\Collection || $userInfo instanceof \think\Paginator ) && $userInfo->isEmpty())): ?>
       <button id="btn-login" style="margin-left: 45%;background: #EB7350;" class="layui-btn">登录</button>
       <a href="/home/index/register" class="layui-btn">注册</a>
       <?php endif; if(!(empty($userInfo) || (($userInfo instanceof \think\Collection || $userInfo instanceof \think\Paginator ) && $userInfo->isEmpty()))): ?>  
        <li class='layui-nav-item' style='float: right;margin-right: 100px;'>
        </li>
        <li class='layui-nav-item' style='float: right;position: relative;left: -100px;'>
            <a href='javascript:;'><img src='<?php if(!(empty($userInfo['face']) || (($userInfo['face'] instanceof \think\Collection || $userInfo['face'] instanceof \think\Paginator ) && $userInfo['face']->isEmpty()))): ?><?php echo $userInfo["face"]; endif; if(empty($userInfo['face']) || (($userInfo['face'] instanceof \think\Collection || $userInfo['face'] instanceof \think\Paginator ) && $userInfo['face']->isEmpty())): ?>/static/images/default_face.jpg<?php endif; ?>' class='layui-nav-img'><?php echo $userInfo["username"]; ?></a>
            <dl class='layui-nav-child'>
                <dd><a href='/home/ucenter/index'>个人中心</a></dd>
                <dd><a href='/home/ucenter/exitLogin'>退出登录</a></dd>
            </dl>
        </li>
       <?php endif; ?>
    </ul>
    <script>
        layui.use('element', function(){
            var element = layui.element;

            //…
        });
    </script>
</nav>
<!--登录注册-->
<div id="LoginDiv" style="display: none;padding-top:20px">
    <form  method="post" id="LoginForm" >
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
               <input type="text" name="username" placeholder="手机号/邮箱/用户名" required lay-verify="required"  autocomplete="off" class="layui-input">
            </div>           
        </div>      
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
               <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>          
       </div>
       <div class="layui-form-item" id="code-div" style="display: none;">
            <label class="layui-form-label">验证码</label>
            <div class="layui-input-inline">
               <input style="width:80px;float:left;" type="text" name="code" required lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
               <img style="height:37px;width:110px;cursor: pointer;" id="code-img" style="margin-left:55px;margin-bottom:20px" src="<?php echo captcha_src(); ?>" id="yzm" onclick="this.src='<?php echo captcha_src(); ?>?x='+Math.random();" />
            </div>
       </div>          
       <input style="margin-left:55px;margin-bottom:20px;width:250px;" name="loginsubmit" id="btn_Login" class="layui-btn layui-btn-normal" type="button" value="登录" />
       <p style="margin-left:55px;color:#9F9FA6">第三方登录</p>
       <ul style="margin-left:55px;padding:10px">
         <li style="float:left;margin-right:10px;"><a href="#"><i class="layui-icon layui-icon-login-wechat" style="font-size: 30px; color: #5FB878;"></i></a></li>
         <li style="float:left;"><a href="#"><i class="layui-icon layui-icon-login-qq" style="font-size: 30px; color: #1E9FFF;"></i></a></li>
      </ul>
      <p style="margin-top:40px;text-align:center ;"><a href="<?php echo url('/home/index/register'); ?>">注册</a>|<a href="<?php echo url('/home/index/register'); ?>">忘记密码</a></p>
    </form>
</div>
<script>
    $('#btn-login').click(function(){
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                type: 1,
                title:'用户登录',
                area: ['370px', '410px'],
                content: $('#LoginDiv')
            });
        });
    })

    //登录JS
    $("#btn_Login").click(function(){
        var data = $("#LoginForm").serialize();
        $.ajax({
           type:"post",
            url:'/home/index/login',
            data:data,
            dataType:'json',
            success:function(e){
                switch(e.code)
                {                  
                    case 0:
                        if(e.count > 5){
                        $("#code-div").show();
                        }
                        layer.msg(e.msg, {icon: 5,time:1000});
                        document.getElementById('code-img').src='<?php echo captcha_src(); ?>?x='+Math.random()
                        break;
                    case 1:
                        layer.msg(e.msg, {icon:1});
                        location.href='/';
                        break;


                }

            },
        })
    })
</script>
<!--自定义JS代码-->
<?php echo htmlspecialchars_decode($statistics); ?>
<div class="content" style="height: 1400px;">
    <div class="list" style="margin-top: 50px">
        <?php if(is_array($articleList) || $articleList instanceof \think\Collection || $articleList instanceof \think\Paginator): $i = 0; $__LIST__ = $articleList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <div class="list-content">
            <div class="list-img"><img src="<?php echo (isset($vo['img']) && ($vo['img'] !== '')?$vo['img']:'/themes/blog/static/images/default/default.jpg'); ?>"/></div>
            <div class="list-right">
                <a  href="/<?php echo $vo['article_id']; ?>.html" target="_blank" style="font-size: 20px;color:#2D93CA"><?php echo $vo['title']; ?></a>
                <p style="color: #C0C0C0;margin: 5px;">
                    <i class="layui-icon" style="font-size: 15px;">&#xe638;</i> <?php echo $vo['category_name']; ?> &nbsp; &nbsp;
                    <i class="layui-icon" style="font-size: 15px;">&#xe612;</i> <?php echo $vo['username']; ?> &nbsp; &nbsp;
                    <i class="layui-icon" style="font-size: 15px;">&#xe60e;</i> <?php echo $vo['create_time']; ?>
                </p>
                <p style="font-size: 17px;color: #666666;"><?php echo mb_substr(strip_tags(htmlspecialchars_decode($vo['content'])),0,80,'utf-8'); ?></p>
            </div>
        </div>
        <hr />
        <?php endforeach; endif; else: echo "" ;endif; if(empty($articleList) || (($articleList instanceof \think\Collection || $articleList instanceof \think\Paginator ) && $articleList->isEmpty())): ?><div class="list-content"><p style="color:#EB7350;font-size: 22px;">这家伙很懒，什么也没留下</p></div><?php endif; ?>
    </div>
    <!--右侧栏目-->
<div class="right">
  <!--微信公众号+
  <div class="tougao">
    <h1>TnCMS小程序</h1>
    <img src="/themes/blog/static/images/TnCMS.jpg" width="250px" height="250px"/>
  </div>-->
  <!--分类目录-->
  <div class="rightList tag">
    <h1>分类目录</h1>
    <hr class="layui-bg-red">
    <?php if(is_array($tag) || $tag instanceof \think\Collection || $tag instanceof \think\Paginator): $i = 0; $__LIST__ = $tag;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <a href="<?php echo url('/category/' .$vo['id']); ?>"><?php echo $vo['category_name']; ?></a>
    <?php endforeach; endif; else: echo "" ;endif; ?>
  </div>
  <!--热门文章-->
  <div class="rightList">
    <h1>热门文章</h1>
    <hr class="layui-bg-orange">
    <?php if(is_array($hot_list) || $hot_list instanceof \think\Collection || $hot_list instanceof \think\Paginator): $i = 0; $__LIST__ = $hot_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <div class="list-content">
      <div class="list-img"><img src="<?php echo (isset($vo['img']) && ($vo['img'] !== '')?$vo['img']:'/uploads/default/default_cover.jpg'); ?>"/></div>
      <div class="list-right">
        <a  href="<?php echo url('/' .$vo['article_id']); ?>" target="_blank" style="font-size: 15px;color:#737383"><?php echo mb_substr(strip_tags(htmlspecialchars_decode($vo['title'])),0,15,'utf-8'); ?></a>
        <p style="color: #C0C0C0;margin: 5px;"><?php echo date("Y年m月d日",$vo['create_time']); ?></p>
      </div>
    </div>
    <hr />
    <?php endforeach; endif; else: echo "" ;endif; ?>
  </div>
  <div class="rightList">
    <h1>随机推荐</h1>
    <hr class="layui-bg-green">
    <?php if(is_array($random_list) || $random_list instanceof \think\Collection || $random_list instanceof \think\Paginator): $i = 0; $__LIST__ = $random_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <div class="list-content">
      <div class="list-img"><img src="<?php echo (isset($vo['img']) && ($vo['img'] !== '')?$vo['img']:'/uploads/default/default_cover.jpg'); ?>"/></div>
      <div class="list-right">
        <a  href="<?php echo url('/' .$vo['article_id']); ?>" target="_blank" style="font-size: 15px;color:#737383"><?php echo mb_substr(strip_tags(htmlspecialchars_decode($vo['title'])),0,15,'utf-8'); ?></a>
        <p style="color: #C0C0C0;margin: 5px;"><?php echo date("Y年m月d日",$vo['create_time']); ?></p>
      </div>
    </div>
    <hr />
    <?php endforeach; endif; else: echo "" ;endif; ?>
  </div>
  <?php echo hook('ad2'); ?>
</div>
</div>
<style>
    .link{width:1180px;height:auto;margin: 0 auto;background:#FFF;margin-top:20px;padding:10px;overflow:hidden}
    .link ul li{float:left;margin-right:10px;}
    .link ul li a{color:#8E8E8E;}
    .footer{width: 100%;height: auto;background: #2E2D3C;float:right;margin-top: 20px;padding: 20px 0px 20px 0px }
    .footer .footer_content{width: 1200px;height: auto;margin: 0 auto}
    .footer .footer_content p{color: #FFF}
</style>
<div style="width:100%;height:auto;float: right;">
    <div class="link">
        <h1 style="font-size: 20px;color:#E3670C">友情链接</h1>
        <hr />
        <ul>
            <?php if(is_array($link) || $link instanceof \think\Collection || $link instanceof \think\Paginator): $i = 0; $__LIST__ = $link;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
            <li><a href="<?php echo $vo['link_url']; ?>"><?php echo $vo['link_title']; ?></a></li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
    </div>
</div>
<div class="footer">
    <div class="footer_content">
        <p>反馈建议：mmteen@sina.com</p>
        <p>Copyright © 2018 <?php echo $siteInfo['title']; ?>.保留所有权利<a style="color:#fff;margin-left:30px;" href="http://www.miitbeian.gov.cn"><?php echo $siteInfo['record_number']; ?></a></p>
    </div>
</div>
</body>
</html>